package com.jason.java.lib;

/**
 * Description:TwoArray
 *
 * @author 陈宝阳
 * @create 2020/9/15 18:53
 */
public class TwoArray {

  public static void main(String[] args) {

    int[][] arr = {{12,23},{4,5,6,7},{9}};

    //外循环遍历有多少个一维数组
    for(int i =0;i <arr.length;i++) {
      //内循环遍历每一个一维数组的元素
      for (int j = 0; j < arr[i].length; j++) {

        if (arr[i][j] == 4) {
          System.out.println("arr[" + i + "][" + j + "] = " + arr[i][j]);
          //这边用break，只是跳出一层循环
          return;
        }
      }
    }
  }
}
